import { $Http } from '@/config/service/http';

// 档案续借
export enum Api {
  /**
   * method：POST
   * Content-Type：application/json
   */
  archivesRenewInfoPage = '/dms/archivesRenewInfo/page', // 分页查询
  archivesRenewInfoAutoProductFormInfo = '/dms/archivesRenewInfo/autoProductFormInfo', // 自动生成表单
  archivesBorrowFindBorrowFileByFileName = '/dms/archivesBorrow/findBorrowFileByFileName', // 通过借阅文件名称或文件编码模糊查询文件
  archivesRenewInfoSave = '/dms/archivesRenewInfo/save', // 保存
  archivesRenewInfoAudit = '/dms/archivesRenewInfo/audit', // 审核
  archivesRenewInfoRenewFilesPage = '/dms/archivesRenewInfo/renewFilesPage', // 续借档案列表
  archivesBorrowFindFileListByBorrowInfoIds = '/dms/archivesBorrow/findFileListByBorrowInfoIds', // 通过借阅明细id查询文件

  /**
   * Content-Type：application/x-www-form-urlencoded
   */
  archivesRenewInfoDelete = '/dms/archivesRenewInfo/delete', // 删除（post）

  /**
   * Params：/{id}
   * Content-Type：application/x-www-form-urlencoded
   */
  archivesRenewInfoCloseFlow = '/dms/archivesRenewInfo/closeFlow', // 关闭流程
  archivesRenewInfoRevoke = '/dms/archivesRenewInfo/revoke' // 撤回
}

/**
 * 通过借阅文件名称或文件编码模糊查询文件
 * @param params
 * keyWord 关键词
 */
export const archivesBorrowFindBorrowFileByFileName = (params) => {
  return $Http.api(Api.archivesBorrowFindBorrowFileByFileName, params, 'post');
};

/**
 * 保存
 * @param params
 */
export const archivesRenewInfoSave = (params) => {
  return $Http.api(Api.archivesRenewInfoSave, params, 'post');
};

/**
 * 审核
 * @param params
 * applyResult	审核结果（1=通过；2=驳回）
 * billId	单据id
 * remark	备注
 */
export const archivesRenewInfoAudit = (params) => {
  return $Http.api(Api.archivesRenewInfoAudit, params, 'post');
};

/**
 * 续借档案列表
 * @param params
 * id
 * pageNumber	页码
 * pageSize	分页大小
 * sortField	排序字段
 * sortType	升降序，asc=升序，desc=降序
 */
export const archivesRenewInfoRenewFilesPage = (params) => {
  return $Http.api(Api.archivesRenewInfoRenewFilesPage, params, 'post');
};

/**
 * 通过借阅明细id查询文件
 * @param params
 * borrowInfoIds	明细ids
 */
export const archivesBorrowFindFileListByBorrowInfoIds = (params) => {
  return $Http.api(Api.archivesBorrowFindFileListByBorrowInfoIds, params, 'post');
};
